<template>
	<view v-if="searchData.length !== 0">
		<view class="text" v-for="item in searchData" :key="item.id" @click="router(item.id, item.doctorName)">
			<uni-icons type="search" size="24" class='icon'></uni-icons>
			{{item.doctorName}}
		</view>
	</view>
	<view class="kong" v-else>
		暂时查询不到
	</view>
</template>

<script>
	export default {
		props: ['searchData'],
		data() {
			return {};
		},
		methods: {
			router(id, name) {
				this.$emit('addHis', name)
				uni.navigateTo({
					url: `/pages/questions/detail?id=${id}`
				})
			}
		}
	}
</script>

<style lang="less">
	.text {
		padding: 20upx 0;
		padding-left: 100upx;
		border-bottom: 2upx solid rgba(203, 203, 203, 0.5);
		background-color: white;
		position: relative;

		.icon {
			position: absolute;
			top: 9px;
			left: 15px;
		}
	}

	.kong {
		padding: 100upx 0;
		background: white;
		text-align: center;
	}
</style>
